# 启用编译数据库生成（全局生效）
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# 设置最低CMake 版本要求
cmake_minimum_required(VERSION 3.10)

# 设置项目名称
project(Thread_Pool VERSION 1.0.0 LANGUAGES C)

# 设置C语言标准
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED True)

# 包含头文件目录
include_directories(
	${PROJECT_SOURCE_DIR}/include
)

# 指定源文件目录下的所有.c 文件 
file(GLOB TEST_SOURCES "./test/*.c")
file(GLOB LIB_SOURCES "./include/*.c")

# 设置目标可执行文件
add_executable(main ${TEST_SOURCES} ${LIB_SOURCES})

# 链接 pthread 库
target_link_libraries(main pthread)

# 清理中间的.o文件
set_target_properties(main PROPERTIES CLEAN_DIRECT_OUTPUT 1)
